add support for loading VAE autoencoders #1216
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To add a VAE autoencoder to an existing model:
Download the appropriate autoencoder and put it into models/ldm/stable-diffusion
Note that you MUST use a VAE that was written for the original CompViz Stable Diffusion codebase. For v1.4, that would be the file named vae-ft-mse-840000-ema-pruned.ckpt that you can download from https://huggingface.co/stabilityai/sd-vae-ft-mse-original
Edit config/models.yaml to contain the following stanza, modifying
weightsandvaeas required to match the weights and vae model file names. There is no requirement to rename the VAE file.Alternatively from within the
invoke.pyCLI, you may use the command!editmodel stable-diffusion-1.4to bring up a simple editor that will allow you to add the path to the VAE.If you are just installing InvokeAI for the first time, you can also use
!import_model models/ldm/stable-diffusion/sd-v1.4.ckptinstead to create the configuration from scratch.That's it!